.file-editor-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  background-color: var(--editor-bg);
  overflow: hidden; /* 防止溢出 */
}

.editor-container {
  flex: 1;
  min-height: 300px;
  position: relative;
  width: 100%;
  height: 100%; /* 确保容器填满父元素 */
  display: flex; /* 使Monaco编辑器能够正确计算尺寸 */
  flex-direction: column;
  z-index: 1; /* 确保编辑器在正常状态下可以交互 */
}

/* Monaco编辑器的容器样式 */
.editor-container .monaco-editor {
  width: 100% !important;
  height: 100% !important;
}

/* 确保编辑器内容区域可见 */
.editor-container .monaco-editor .overflow-guard {
  width: 100% !important;
  height: 100% !important;
}

/* 工具栏样式 */
.file-editor-toolbar {
  z-index: 2;
  position: relative;
}

/* 状态栏样式 */
.editor-status-bar {
  z-index: 2;
  position: relative;
}

/* 遮罩层基础样式 */
.overlay-base {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* 默认不阻止点击 */
}

/* 加载指示器 */
.loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
}

/* 进度条容器 */
.loading-progress-bar-container {
  width: 200px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

/* 进度条 */
.loading-progress-bar {
  height: 100%;
  background-color: #1890ff;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* 错误消息 */
.error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 4px;
  color: white;
  z-index: 100;
}

.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.error-text {
  margin-bottom: 8px;
}

/* 刷新指示器 */
.refresh-indicator {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 4px;
  color: white;
  z-index: 100;
  display: flex;
  align-items: center;
}

/* 搜索和过滤面板 */
.search-panel {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 300px;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.panel-content {
  padding: 12px;
}

.search-options {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-stats {
  margin: 12px 0;
  font-size: 12px;
  color: #666;
}

.search-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

/* 右键菜单 */
.context-menu {
  z-index: 1000;
  position: fixed;
  background: var(--editor-content-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  pointer-events: auto;
}

.file-editor-main .filter-stats {
  position: absolute;
  bottom: 32px; /* 调整位置，避免与状态栏重叠 */
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
}

.file-editor-main .refresh-indicator {
  position: absolute;
  top: 8px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
}

.search-dialog,
.filter-dialog {
  padding: 16px;
}

.search-dialog .ant-input-affix-wrapper,
.filter-dialog .ant-input-affix-wrapper {
  margin-bottom: 16px;
}

.search-options,
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 对话框样式 */
.ant-modal-confirm .ant-modal-confirm-btns {
  margin-top: 24px;
}

.ant-modal-confirm .ant-modal-confirm-content {
  margin-top: 16px;
}

.ant-modal-confirm .ant-modal-confirm-title {
  color: var(--editor-text);
}

.ant-modal-confirm .ant-checkbox-wrapper {
  color: var(--editor-text);
}

.ant-modal-confirm .ant-input-affix-wrapper {
  background-color: var(--editor-content-bg);
  border-color: var(--editor-border);
}

.ant-modal-confirm .ant-input-affix-wrapper:hover,
.ant-modal-confirm .ant-input-affix-wrapper:focus {
  border-color: var(--status-info);
}

.ant-modal-confirm .ant-input {
  background-color: transparent;
  color: var(--editor-text);
}

.ant-modal-confirm .ant-input::placeholder {
  color: var(--editor-line-number);
}

.ant-modal-confirm .ant-btn-primary {
  background-color: var(--status-info);
  border-color: var(--status-info);
}

.ant-modal-confirm .ant-btn-primary:hover {
  background-color: var(--status-info-hover);
  border-color: var(--status-info-hover);
}

/* 大文件加载相关样式 */
.load-more-indicator {
  position: absolute;
  bottom: 40px; /* 留出状态栏的高度 */
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 4px;
  color: white;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.load-more-indicator .ant-btn-link {
  color: white;
}

.load-more-indicator .ant-btn-link:hover {
  color: #1890ff;
}

.load-more-indicator .ant-btn-link:disabled {
  color: rgba(255, 255, 255, 0.5);
} 